package domain

// 用户信息实体：指定；列名
type User struct {
	ID           string `gorm:"column:id" structs:"id" json:"id"`
	Name         string `gorm:"column:name" structs:"name" json:"name"`
	UserID       string `gorm:"column:userID" structs:"userid" json:"userid"`
	UserPassword string `gorm:"column:userPassword" structs:"password" json:"password"`
	NickName     string `gorm:"column:nickName" structs:"nickname" json:"nickname"`
	HeadPicPath  string `gorm:"column:headPicPath" structs:"headpicpath" json:"headpicpath"`
	UserIdentity string `gorm:"column:userIdentity" structs:"identity" json:"identity"`
	Grade        string `gorm:"column:grade" structs:"grade" json:"grade"`
	School       string `gorm:"column:school" structs:"school" json:"school"`
	UnionID      string `gorm:"column:unionID" structs:"unionid" json:"unionid"`
	ActivityID   string `gorm:"column:activityID" structs:"activityid" json:"activityid"`
}

// 将类转化为字符串输出
func (u User) ToString() string {
	var resStr string
	resStr = "{ name: " + u.Name + " , userID: " + u.UserID + " , userPassword: " + u.UserPassword + " , nickName: " + u.NickName + " , headPicPath:" + u.HeadPicPath + " , OpenID: " + u.UnionID + " , UserIdentity: " + u.UserIdentity + " , grade: " + u.Grade + " , school: " + u.School
	return resStr
}

// 指定表名
func (user User) TableName() string {
	return "userinfo"
}
